home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / pjp / oswrite.c < prev   
Encoding:
C/C++ Source or Header  |  1994-10-02  |  332 b   |  16 lines

  1. ---------------- Listing 10: The file oswrite.c ------------
  2.  
  3. // oswrite -- ostream::write(const char *, int)
  4. #include <ostream>
  5.  
  6. ostream& ostream::write(const char *s, int n)
  7.     {    // put n bytes
  8.     _TRY_IO_BEGIN
  9.     if (!opfx() || rdbuf()->sputn(s, n) != n)
  10.         setstate(badbit);
  11.     osfx();
  12.     _CATCH_IO_END
  13.     return (*this);
  14.     }
  15.  
  16.